package main

import (
	"fmt"
	"sync"
	"time"
)

var once sync.Once

func main() {
	for i := 0; i < 10; i++ {

		go func() {
			fmt.Println(2222)
			once.Do(onced)
			fmt.Println("213")
		}()
	}
	fmt.Println(3333)
	time.Sleep(2*time.Second)
}

func onced() {
	fmt.Println("onced")
}